﻿using System;
using System.Collections.Generic;
using NOSDC.Pocos;
using System.Web.Security;
using NOSDC.Utility;
using System.Web.Mvc;

namespace NOSDC.Areas.Admin.Models
{
    public sealed class ArticleViewModel
    {
        public Article Article { get; set; }
        public IEnumerable<SelectListItem> StatusValues { get; set; }
        
        public ArticleViewModel()
        {
            Article = new Article()
            {
                DatePosted = DateTime.Now,
                IPAddress = Helper.GetIPAddress(),
                StatusID = 1,
                PostedBy = new Guid(Membership.GetUser().ProviderUserKey.ToString())
            };

            StatusValues = new List<SelectListItem>()
            {
                new SelectListItem(){
                    Text = "Active",
                    Value= "1",
                    Selected = true
                },
                   new SelectListItem(){
                    Text = "Inactive",
                    Value= "2",
                    Selected = false
                }
            };
        }
    }
}